Secrets
You can store sensitive data such as passwords, tokens, confidential configuration data, or any other types of data that you want to protect as application secrets. To access such data inside the app corva-sdk provides secrets
object.
See testing secrets section to see how to test an app that uses secrets.
from corva import Api, TaskEvent, secrets, task #1
@task
def task_app(event: TaskEvent, api: Api):
secrets['api_token'] #2
int(secrets['integer']) #3
- Import secrets object.
secrets
is a dictionary so use key to retrieve the value.- Values are stored as strings, cast the value to required type as needed. Example shows how to get the integer.